package com.hotel.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;

/**
 * 
 * @TableName ht_consume
 */
@TableName(value ="ht_consume")
@Data
public class HtConsume implements Serializable {
    /**
     * 入住单号，系统自动生成
     */
    @TableId
    private String checkInNo;

    /**
     * 客房编号
     */
    private Long roomNo;

    /**
     * 商品编号
     */
    private Long commodityNo;

    /**
     * 数量
     */
    private Integer buyNumbers;

    /**
     * 单价
     */
    private Double unitPrice;

    /**
     * 消费金额
     */
    private Double consumeMoney;

    /**
     * 折扣率
     */
    private Double discountRate;

    /**
     * 折扣金额
     */
    private Double discountMoney;

    /**
     * 合计，自动计算
     */
    private Double total;

    /**
     * 操作员
     */
    private String operator;

    /**
     * 消费时间
     */
    private Date consumeTime;

    /**
     * 备注
     */
    private String consumeRemark;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        HtConsume other = (HtConsume) that;
        return (this.getCheckInNo() == null ? other.getCheckInNo() == null : this.getCheckInNo().equals(other.getCheckInNo()))
            && (this.getRoomNo() == null ? other.getRoomNo() == null : this.getRoomNo().equals(other.getRoomNo()))
            && (this.getCommodityNo() == null ? other.getCommodityNo() == null : this.getCommodityNo().equals(other.getCommodityNo()))
            && (this.getBuyNumbers() == null ? other.getBuyNumbers() == null : this.getBuyNumbers().equals(other.getBuyNumbers()))
            && (this.getUnitPrice() == null ? other.getUnitPrice() == null : this.getUnitPrice().equals(other.getUnitPrice()))
            && (this.getConsumeMoney() == null ? other.getConsumeMoney() == null : this.getConsumeMoney().equals(other.getConsumeMoney()))
            && (this.getDiscountRate() == null ? other.getDiscountRate() == null : this.getDiscountRate().equals(other.getDiscountRate()))
            && (this.getDiscountMoney() == null ? other.getDiscountMoney() == null : this.getDiscountMoney().equals(other.getDiscountMoney()))
            && (this.getTotal() == null ? other.getTotal() == null : this.getTotal().equals(other.getTotal()))
            && (this.getOperator() == null ? other.getOperator() == null : this.getOperator().equals(other.getOperator()))
            && (this.getConsumeTime() == null ? other.getConsumeTime() == null : this.getConsumeTime().equals(other.getConsumeTime()))
            && (this.getConsumeRemark() == null ? other.getConsumeRemark() == null : this.getConsumeRemark().equals(other.getConsumeRemark()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getCheckInNo() == null) ? 0 : getCheckInNo().hashCode());
        result = prime * result + ((getRoomNo() == null) ? 0 : getRoomNo().hashCode());
        result = prime * result + ((getCommodityNo() == null) ? 0 : getCommodityNo().hashCode());
        result = prime * result + ((getBuyNumbers() == null) ? 0 : getBuyNumbers().hashCode());
        result = prime * result + ((getUnitPrice() == null) ? 0 : getUnitPrice().hashCode());
        result = prime * result + ((getConsumeMoney() == null) ? 0 : getConsumeMoney().hashCode());
        result = prime * result + ((getDiscountRate() == null) ? 0 : getDiscountRate().hashCode());
        result = prime * result + ((getDiscountMoney() == null) ? 0 : getDiscountMoney().hashCode());
        result = prime * result + ((getTotal() == null) ? 0 : getTotal().hashCode());
        result = prime * result + ((getOperator() == null) ? 0 : getOperator().hashCode());
        result = prime * result + ((getConsumeTime() == null) ? 0 : getConsumeTime().hashCode());
        result = prime * result + ((getConsumeRemark() == null) ? 0 : getConsumeRemark().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", checkInNo=").append(checkInNo);
        sb.append(", roomNo=").append(roomNo);
        sb.append(", commodityNo=").append(commodityNo);
        sb.append(", buyNumbers=").append(buyNumbers);
        sb.append(", unitPrice=").append(unitPrice);
        sb.append(", consumeMoney=").append(consumeMoney);
        sb.append(", discountRate=").append(discountRate);
        sb.append(", discountMoney=").append(discountMoney);
        sb.append(", total=").append(total);
        sb.append(", operator=").append(operator);
        sb.append(", consumeTime=").append(consumeTime);
        sb.append(", consumeRemark=").append(consumeRemark);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}